﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NiuBeService
{
    public class JsonConfig
    {
        public static T Get<T>(string jsonFile)
        {
            try
            {
                jsonFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "JsonConfig", jsonFile);
                var jobStr = File.ReadAllText(jsonFile, Encoding.UTF8);
                var info = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(jobStr);
                return info;
            }
            catch
            {
                return default;
            }
        }
    }
}
